#include<iostream>
#include<map>
using namespace std;
map<int, int> mp;
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		mp.clear();
		cin >> n;
		int ma = -1e5;
		for (int i = 1; i <= n; i++) {
			int x;
			cin >> x;
			mp[x]++;
			if (ma < mp[x]) {
				ma = mp[x];
			}
		}
		int cnt = 0;
		for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
			if (ma == it->second) {
				cnt++;
			}
		}
		if (cnt == mp.size()) {
			cout << -1 << endl;
			continue;
		}
		cout << cnt << endl;
		bool flag = 1;
		for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
			if (ma == it->second) {
				if (flag) {
					flag = 0;
					cout << it->first;
				}
				else {
					cout << " " << it->first;
				}
			}
		}
		cout << endl;
	}
	return 0;
}